package com.lhd.article.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.lhd.model.article.dtos.ArticleCommentDto;
import com.lhd.model.article.dtos.ArticleHomeDto;
import com.lhd.model.article.pojos.ApArticle;
import com.lhd.model.article.vos.ArticleCommnetVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * @CreateTime: 2023/8/7
 * @Author: <==lhd==>
 * @Description:
 */
@Mapper
public interface ApArticleMapper extends BaseMapper<ApArticle> {

    /**
     * 加载文章列表
     * @param articleHomeDto
     * @param type
     * @return
     */
    public List<ApArticle> loadArticleList(@Param("dto") ArticleHomeDto articleHomeDto,@Param("type") Short type);

    public List<ApArticle> findArticleListByLast5days(@Param("dayParam") Date dayParam);

    public Map queryLikesAndConllections(@Param("wmUserId") Integer wmUserId, @Param("beginDate") Date beginDate, @Param("endDate")  Date endDate);

    List<ArticleCommnetVo> findNewsComments(@Param("dto") ArticleCommentDto dto);

    int findNewsCommentsCount(@Param("dto")  ArticleCommentDto dto);

}
